


import java.io.File;
import java.util.ArrayList;
import java.util.List;

import org.wizehack.mri.exception.InvalidFileExtensionException;
import org.wizehack.mri.test.BasicTestSuite;
import org.wizehack.mri.test.TestSuite;
import org.wizehack.mri.testSet.SimilaritybasedSelectionStrategy;

public class SimilaritybasedSelectionTest {
	private static String DIR = "/home/hsyoun/workspace/jgraphx/ExprData/data";
	private static String EXP_DIR = "/home/hsyoun/workspace/jgraphx/ExprData/";
	private static String XML_DTD = "/home/hsyoun/workspace/jgraphx/ExprData/data/report.dtd";

//	private static String DIR = "/home/hsyoun/workspace/jgraphx/Data/5";
//	private static String EXP_DIR = "/home/hsyoun/workspace/jgraphx/Data/";
//	private static String XML_DTD = "/home/hsyoun/workspace/jgraphx/Data/report.dtd";
	private static double TRESHOLD = 0.0;
	
	public SimilaritybasedSelectionTest() {
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		SimilaritybasedSelectionStrategy strategy = new SimilaritybasedSelectionStrategy(TRESHOLD);

		List<String> failedCoverageFileList = new ArrayList<String>();
//		failedCoverageFileList.add(DIR + "/7.xml");
//		failedCoverageFileList.add(DIR + "/12.xml");
//		failedCoverageFileList.add(DIR + "/13.xml");
		failedCoverageFileList.add(DIR + "/2-4_fault_vdx.xml");
		failedCoverageFileList.add(DIR + "/2-5_fault_pagesetup.xml");
		failedCoverageFileList.add(DIR + "/3-5_fault_about.xml");

		TestSuite testSuite = new BasicTestSuite();
		strategy.setFailedCoverageFileList(failedCoverageFileList);
		strategy.setDirectory(DIR + File.separator);
		List<TestSuite> tSuiteList = new ArrayList<TestSuite>();
		tSuiteList.add(testSuite);
		List<TestSuite> testSuiteList = strategy.select(tSuiteList);
		
		try {
			strategy.exportTo(testSuiteList, EXP_DIR, XML_DTD);
		} catch (InvalidFileExtensionException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
